﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using EARS.App_Code;

namespace EARS
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnLogin_Click(object sender, EventArgs e)
        {
            Account a = new Account();
            bool check = a.Login(txtUserID.Text, txtPassword.Text);
            if (check == true)
            {
                FormsAuthentication.RedirectFromLoginPage(txtUserID.Text, false);
            }
            else
            {
                lblError.Text = "Incorrect User ID & Password. Please try again.";
            }
            //if (txtUserID.Text.Equals("1003726E") && txtPassword.Text.Equals("TB259887"))
            //{
            //    FormsAuthentication.RedirectFromLoginPage(txtUserID.Text, false);
            //}
        }

        protected void btnForgetPassword_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/ForgetPassword.aspx");
        }

        protected void btnCreate_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/CreateAccount.aspx");
        }
    }
}